package main

import (
	"go-base/src/configs"
	"go-base/src/core/kafka"
	"go-base/src/core/server"
	"go-base/src/db"
	"go-base/src/logs"
	"go-base/src/route"
	"go.uber.org/zap"
)

func init() {
	//读取配置文件
	configs.Init("config")
	// 初始化日志库
	logs.SetLogs(zap.InfoLevel,
		logs.LOGFORMAT_CONSOLE,
		configs.Conf.LogUrl,
		configs.Conf.LogSize,
		configs.Conf.MaxBackups,
		configs.Conf.LogAge,
		configs.Conf.Compress,
	)
}

// @title go-base
// @version 0.0.1
// @description base 项目
// @host localhost:13333
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name token
// @contact.url
// @contact.name
func main() {
	//数据库和redis
	db.Init()
	//mq
	kafka.Init()
	//路由
	r := route.Init()
	//启动服务
	server.StartServer(r)
}
